//2009/08/09 16:20:22
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <algorithm>

using namespace std;

class Swimmers
{
public:
    vector <int> getSwimTimes(vector <int> distances, vector <int> speeds, int current)
    {
		vector<int> ret;
		ret.clear();
		for(int i=0; i<speeds.size(); i++)
		{
			if(distances[i] == 0) 
			{
				ret.push_back(0);
				continue;
			}
			if(speeds[i] <= current) 
			{
				ret.push_back(-1);
				continue;
			}
			int times = distances[i] * 2 * speeds[i] / (speeds[i] * speeds[i] - current * current);
			ret.push_back(times);
		}
		return ret;
    }
};
